//赛事状态枚举组件
import {
    MinusCircleOutlined,
    PauseCircleOutlined,
    CheckCircleOutlined,
    CheckOutlined,
    SyncOutlined,
    WarningOutlined
} from '@ant-design/icons';
import { Tag } from 'antd';
const CompStatusEnum = (statusData) => {
    if(statusData === undefined || statusData === null){
        statusData = 'UN_KNOWN';
    }
    const STATUS_MAP = {
        UN_KNOWN: {
            title: '未知',
            color: 'default',
            icon: <MinusCircleOutlined />
        },
        CREATED: {
            title: '已创建',
            color: 'blue',
            icon: <CheckOutlined/>
        },
        INITIALIZING: {
            title: '初始化中',
            color: 'processing',
            icon: <SyncOutlined spin />
        },
        INITIALIZATION_FAILED: {
            title: '初始化失败',
            color: 'error',
            icon: <WarningOutlined />
        },
        INITIALIZED: {
            title: '已初始化',
            color: 'success',
            icon: <CheckCircleOutlined />
        },
        READY_FOR_COMP: {
            title: '即将比赛',
            color: 'orange',
            icon: <SyncOutlined spin />
        },
        PREPARING: {
            title: '靶机加固中',
            color: 'cyan',
            icon: <SyncOutlined spin />
        },
        IN_THE_COMP: {
            title: '比赛中',
            color: 'gold',
            icon: <SyncOutlined spin />
        },
        END_THE_COMP: {
            title: '比赛结束',
            color: 'default',
            icon: <MinusCircleOutlined />
        },
        PAUSE: {
            title: '比赛暂停',
            color: 'red',
            icon: <PauseCircleOutlined />
        }
    }
    return (
        <div>
            <Tag icon={STATUS_MAP[statusData].icon} color={STATUS_MAP[statusData].color}>{STATUS_MAP[statusData].title}</Tag>
        </div>
    )
}
export default CompStatusEnum;